import request from '@/utils/request';
import {
    Period,
    ConsultantScheduling,
    ModifySchedule,
    Student,
    Academy,
    ClassList,
    RestPassword,
    AddStudent, AppointmentList, RecordsList
} from '@/api/interfaceApi/params';
// 咨询师列表请求
function getTeacherList(){
    return request({
        url:'/system/teacher/teacherAllList',
        method:'get',
    });
}
//某个咨询师的排期
function  getConsultantScheduling(params:ConsultantScheduling){
    return request({
        url:'/schedule/list',
        method:'get',
        params,
    });
}
// 修改排期
function modifySchedule(data:ModifySchedule){
    return request({
        url:'/schedule/edit',
        method:'put',
        data,
    });
}
// 时间段列表
function timePeriodList(){
    return request({
        url:'/time/list',
        method:'get',

    });
}
// 删除预约时间段
function deleteTimePeriod(data:string[]){
    return request({
        url:'/time/delete',
        method:'delete',
        data
    });
}
// 添加预约时间段
function addTimePeriod(data:Period){
    return request({
        url:'/time/add',
        method:'post',
        data
    });
}
// 修改预约时间段
function modifyTimePeriod(data:Period){
    return request({
        url:'/time/edit',
        method:'put',
        data
    });
}
// 学生列表
function getStudentList(params:Student){
    return request({
        url:'/system/student/list',
        method:'get',
        params
    });
}
// 学院列表 listOfs
function getAcademyList(params:Academy){
    return request({
        url:'/system/dept/list',
        method:'get',
        params
    });
}
// 班级列表
function getClassList(params:ClassList){
    return request({
        url:'/student/class/list',
        method:'get',
        params
    });
}
// 更新学生信息
function modifyStudentInfo(data:Student){
    return request({
        url:'/system/student/edit',
        method:'post',
        data
    })
}
// 删除学生
function deleteStudentInfo(data:string[]){
    return request({
        url:'/system/student/remove',
        method:'delete',
        data
    })
}
// 重置密码
function resetStudentPassword(params:RestPassword){
    return request({
        url:'/system/student/resetPwd',
        method:'post',
        params
    })
}
// 添加学生
function studentAdd(data:AddStudent){
    return request({
        url:'/system/student/add',
        method:'post',
        data
    })
}
// 全部导出
function exportAllStudent(){
    return request({
        url:'/system/student/export',
        method:'post',
        responseType: "blob",  //代表请求 blob数据格式
        responseEncoding: "utf8" // 使用UTF-8编码
    })
}
// 部分导出
function partialExport (data:string[]){
    return request({
        url:'/system/student/partExport',
        method:'post',
        responseType: "blob",  //代表请求 blob数据格式
        responseEncoding: "utf8", // 使用UTF-8编码
        data
    })
}
// 获取学生信息
function getStudentInfo(id:string){
    return request({
        url:`/system/student/${id}`,
        method:'get'
    })
}
// 预约信息
function getAppointmentList(params:AppointmentList){
    return request({
        url:`/appointment/list`,
        method:'get',
        params,
    })
}
// 测评记录
function evaluationRecordsList(params:RecordsList){
    return request({
        url:`/evaluation/student/record`,
        method:'get',
        params,
    })
}
// 获取系统消息列表
function getMessageList(receiverId:string,params:any){
    return request({
        url:`/system/list/list/${receiverId}`,
        method:'get',
        params
    })
}
// 全部已读
function allRead(data:any){
    return request({
        url:`/system/list/update`,
        method:'post',
        data
    })
}
// 全部删除
function allDelete(data:any){
    return request({
            url:`/system/list/delete`,
            method:'post',
            data
        })
}
export {
    getTeacherList,
    getConsultantScheduling,
    modifySchedule,
    timePeriodList,
    deleteTimePeriod,
    addTimePeriod,
    modifyTimePeriod,
    getStudentList,
    getAcademyList,
    getClassList,
    modifyStudentInfo,
    deleteStudentInfo,
    resetStudentPassword,
    studentAdd,
    exportAllStudent,
    getStudentInfo,
    getAppointmentList,
    partialExport,evaluationRecordsList,
    getMessageList,
    allRead,
    allDelete
};
